16 research outputs found
Continuation-Passing C: compiling threads to events through continuations
In this paper, we introduce Continuation Passing C (CPC), a programming
language for concurrent systems in which native and cooperative threads are
unified and presented to the programmer as a single abstraction. The CPC
compiler uses a compilation technique, based on the CPS transform, that yields
efficient code and an extremely lightweight representation for contexts. We
provide a proof of the correctness of our compilation scheme. We show in
particular that lambda-lifting, a common compilation technique for functional
languages, is also correct in an imperative language like C, under some
conditions enforced by the CPC compiler. The current CPC compiler is mature
enough to write substantial programs such as Hekate, a highly concurrent
BitTorrent seeder. Our benchmark results show that CPC is as efficient, while
using significantly less space, as the most efficient thread libraries
available.Comment: Higher-Order and Symbolic Computation (2012). arXiv admin note:
substantial text overlap with arXiv:1202.324
Capture-Avoiding and Hygienic Program Transformations
Program transformations in terms of abstract syntax trees compromise referential integrity by introducing variable capture. Variable capture occurs when in the generated program a variable declaration accidentally shadows the intended target of a variable reference. Existing transformation systems either do not guarantee the avoidance of variable capture or impair the implementation of transformations.
We present an algorithm called name-fix that automatically eliminates variable capture from a generated program by systematically renaming variables. name-fix is guided by a graph representation of the binding structure of a program, and requires name-resolution algorithms for the source language and the target language of a transformation. name-fix is generic and works for arbitrary transformations in any transformation system that supports origin tracking for names. We verify the correctness of name-fix and identify an interesting class of transformations for which name-fix provides hygiene. We demonstrate the applicability of name-fix for implementing capture-avoiding substitution, inlining, lambda lifting, and compilers for two domain-specific languages
Delimited Control in OCaml, Abstractly and Concretely System Description
Abstract. We describe the first implementation of multi-prompt delimited control operators in OCaml that is direct in that it captures only the needed part of the control stack. The implementation is a library that requires no changes to the OCaml compiler or run-time, so it is perfectly compatible with existing OCaml source code and byte-code. The library has been in fruitful practical use for four years. We present the library as an implementation of an abstract machine derived by elaborating the definitional machine. The abstract view lets us distill a minimalistic API, scAPI, sufficient for implementing multiprompt delimited control. We argue that a language system that supports exception and stack-overflow handling supports scAPI. Our library illustrates how to use scAPI to implement multi-prompt delimited control in a typed language. The approach is general and can be used to add multi-prompt delimited control to other existing language systems.
Scheme with classes, mixins, and traits
Abstract. The Scheme language report advocates language design as the composition of a small set of orthogonal constructs, instead of a large accumulation of features. In this paper, we demonstrate how such a design scales with the addition of a class system to Scheme. Specifically, the PLT Scheme class system is a collection of orthogonal linguistic constructs for creating classes in arbitrary lexical scopes and for manipulating them as first-class values. Due to the smooth integration of classes and the core language, programmers can express mixins and traits, two major recent innovations in the object-oriented world. The class system is implemented as a macro in terms of procedures and a record-type generator; the mixin and trait patterns, in turn, are naturally codified as macros over the class system. 1 Growing a Language The Revised 5 Report on the Scheme programming language [20] starts with the famous proclamation that “[p]rogramming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make additiona
Syntactic Abstraction in Component Interfaces
In this paper, we show how to combine a component system and a macro system. A component system separates the definition of a program fragment from the statements that link it, enabling independent compilation of the fragment. A macro system, in contrast, relies on explicit links among fragments that import macros, since macro expansion must happen at compile time. Our combination places macro definitions inside component signatures, thereby permitting macro expansion at compile time, while still allowing independent compilation and linking for the run-time part of components
PHENOLIC COMPOUNDS RELEASED FROM OAK, CHERRY, CHESTNUT AND
Advantages and drawbacks from the use of oak chips in oenology are well documented; wood oenological value is primarily related to
cooperage potential, and not addressed from the oenologist view; for this reason other woods did not had similar attention. Polyphenols release
is determinant to recognize the oenological value. Untoasted, light, medium and heavy toasted chips from oak, cherry, robinia and chestnut
woods were add, to a model wine solution. Total polyphenolic content using Folin Ciocalteau reagent, absorbance at 280nm, identifi cation and
quantifi cation of low molecular weight phenolic compounds were determined.
Oak and chestnut released high amounts of phenolic compounds whilst cherry presented different behaviour. Robinia had the poorest performance,
regarding low molecular weight phenolic compounds; the high values of absorbance and total polyphenolic found suggest the release of
different phenolics.
To our knowledge, this is the fi rst study reporting toasting infl uence on the release of phenolic compounds from other kinds of wood species
than oak